Optimal. Leaf size=32 \[ 4 \sqrt {a+a \cos (x)}+2 x \sqrt {a+a \cos (x)} \tan \left (\frac {x}{2}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.03, antiderivative size = 32, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3400, 3377,
2718} \begin {gather*} 4 \sqrt {a \cos (x)+a}+2 x \tan \left (\frac {x}{2}\right ) \sqrt {a \cos (x)+a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2718
Rule 3377
Rule 3400
Rubi steps
\begin {align*} \int x \sqrt {a+a \cos (x)} \, dx &=\left (\sqrt {a+a \cos (x)} \sec \left (\frac {x}{2}\right )\right ) \int x \cos \left (\frac {x}{2}\right ) \, dx\\ &=2 x \sqrt {a+a \cos (x)} \tan \left (\frac {x}{2}\right )-\left (2 \sqrt {a+a \cos (x)} \sec \left (\frac {x}{2}\right )\right ) \int \sin \left (\frac {x}{2}\right ) \, dx\\ &=4 \sqrt {a+a \cos (x)}+2 x \sqrt {a+a \cos (x)} \tan \left (\frac {x}{2}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.02, size = 22, normalized size = 0.69 \begin {gather*} 2 \sqrt {a (1+\cos (x))} \left (2+x \tan \left (\frac {x}{2}\right )\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains complex when optimal does not.
time = 0.06, size = 55, normalized size = 1.72
method | result | size |
risch | \(-\frac {i \sqrt {2}\, \sqrt {a \left ({\mathrm e}^{i x}+1\right )^{2} {\mathrm e}^{-i x}}\, \left (2 i {\mathrm e}^{i x}+x \,{\mathrm e}^{i x}+2 i-x \right )}{{\mathrm e}^{i x}+1}\) | \(55\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.51, size = 24, normalized size = 0.75 \begin {gather*} 2 \, {\left (\sqrt {2} x \sin \left (\frac {1}{2} \, x\right ) + 2 \, \sqrt {2} \cos \left (\frac {1}{2} \, x\right )\right )} \sqrt {a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: TypeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int x \sqrt {a \left (\cos {\left (x \right )} + 1\right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.43, size = 31, normalized size = 0.97 \begin {gather*} 2 \, \sqrt {2} {\left (x \mathrm {sgn}\left (\cos \left (\frac {1}{2} \, x\right )\right ) \sin \left (\frac {1}{2} \, x\right ) + 2 \, \cos \left (\frac {1}{2} \, x\right ) \mathrm {sgn}\left (\cos \left (\frac {1}{2} \, x\right )\right )\right )} \sqrt {a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.31, size = 50, normalized size = 1.56 \begin {gather*} \frac {2\,\sqrt {a}\,\sqrt {\cos \left (x\right )+1}\,\left (x\,\cos \left (x\right )+\cos \left (x\right )\,2{}\mathrm {i}-2\,\sin \left (x\right )-x+x\,\sin \left (x\right )\,1{}\mathrm {i}+2{}\mathrm {i}\right )}{\cos \left (x\right )\,1{}\mathrm {i}-\sin \left (x\right )+1{}\mathrm {i}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________